<template>
  <div id="">
       <p>我是测试页面页面</p>
      {{getCount}}
      {{getisPlay}}
      <button @click="change">按钮修改vuex的数据</button>
  </div>
</template>
<script>
import {getDetail} from "@/API"
import {mapGetters } from "vuex"
export default {
  name: "",
  data: () => ({
    id:"",
    distance:0,
    result:null,

  }),
  created() {
    console.log(this.$store)

  },
  computed:{
    //要获取vuex中的数据，最好放到计算属性中
    // mgs(){
    //   return this.$store.state.count
    // }
    ...mapGetters([
     'getCount',"getisPlay"
   ])
  },
  methods: {
    change() {
      //不能直接修改，需要调用mutation里面的方法修改
      //  this.$store.state.count="888416255612525";
      this.$store.commit("changeCount")
    }
  }
}
</script>
<style lang="less" scoped>
</style>
